Option Strict Off
Option Explicit On
Imports System.Collections.Generic

Module MODdbMethods

    Public DatabasePath As String
    Dim strFieldsList, openStr, strColumnWidths As String
    Dim intTotalMatches As Short

    'Private oConn As OleDb.OleDbConnection
    'Private oField As ADODB.Field

    Private Const ConnectionStringFormat As String = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE='{0}'"

    Private strRowToUpdateList As String

    Public fso As Scripting.FileSystemObject

    Public Function init() As Object

        On Error Resume Next

        Dim sFilePath As String

        'UPGRADE_WARNING: Couldn't resolve default property of object getPref(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        sFilePath = getPref("", "defaultDatabasePath")

        fso = New Scripting.FileSystemObject

        If Not fso.FileExists(sFilePath) Then Exit Function

        ' Open the default database ---------------------------------------------------------------------------------------------

        SetTables(sFilePath)

    End Function

    Public Sub SetTables(ByRef sDatabasePath As String)

        Dim conn As OleDb.OleDbConnection
        Dim schema As DataTable

        conn = New OleDb.OleDbConnection(ConnectionString)
        conn.Open()

        If Err.Number <> 0 Then

            logMessage(1, "MODdbMethods", "Could not open ADODB connection", "Connection String = " & ConnectionString, Err.Number, Err.Description)

            MsgBox("Could not open connection to database : " & sDatabasePath & vbCrLf & "Reason : " & Err.Description, MsgBoxStyle.Exclamation)

            Exit Sub

        End If

        Dim restrictions() As String = New String(3) {}

        restrictions(3) = "Table"
        schema = conn.GetSchema("Tables", restrictions)

        FRMmain.LISTtables.Items.Clear()

        Dim i As Integer

        For i = 0 To schema.Rows.Count - 1 Step i + 1
            FRMmain.LISTtables.Items.Add(schema.Rows(i)(2).ToString())
        Next

        FRMmain.LISTfields.Text = "All"
        FRMmain.LISTtables.SelectedIndex = 0

        conn.Close()

    End Sub

    Function GetTableColumns(ByVal table As String) As String()

        Dim cn As New OleDb.OleDbConnection(ConnectionString)
        cn.Open()
        ' get a DataTable with all the info
        Dim dt As DataTable = cn.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Columns, New Object() {Nothing, Nothing, table, Nothing})
        cn.Close()
        ' save the column names into a string array
        Dim columns(dt.Rows.Count - 1) As String
        Dim i As Integer
        For i = 0 To dt.Rows.Count - 1
            columns(i) = dt.Rows(i)(3)
        Next
        Return columns

    End Function

    ' Loop through the fields in the selected table, and add each one to the listbox in the main form -------------------------------------------------------------------------

    Public Sub setFieldsList(ByRef sTable As String, ByRef sDefaultField As String)

        FRMmain.LISTfields.Items.Clear()
        FRMmain.LISTfields.Items.Add("All")

        Dim columns As String() = GetTableColumns(sTable)

        For i As Integer = 0 To columns.Length - 1

            Dim index As Integer = FRMmain.LISTfields.Items.Add(columns(i))
            If columns(i) = sDefaultField Then FRMmain.LISTfields.SetSelected(i, True)

        Next

    End Sub

    Private Function GetList(ByVal Statement As String) As List(Of String)

        'Dim conn As OleDb.OleDbConnection
        Dim schema As DataTable
        Using conn As OleDb.OleDbConnection = New OleDb.OleDbConnection(ConnectionString)

            conn.Open()

            If Err.Number <> 0 Then

                logMessage(1, "MODdbMethods", "Could not open ADODB connection", "Connection String = " & ConnectionString, Err.Number, Err.Description)

                MsgBox("Could not open connection to database : " & DatabasePath & vbCrLf & "Reason : " & Err.Description, MsgBoxStyle.Exclamation)

                Exit Function

            End If

            Dim command As OleDb.OleDbCommand

            command = New OleDb.OleDbCommand(Statement, conn)

            Dim reader As OleDb.OleDbDataReader = command.ExecuteReader()

            Dim list As List(Of String) = New List(Of String)

            While reader.Read()

                list.Add(reader.FieldCount)

            End While

            conn.Close()

        End Using

    End Function

    '---------------------------------------'
    '   Search DataBase                     '
    '---------------------------------------'
    Public Function searchDB(ByRef tableToSearch As String, ByRef fieldTosearch As String, ByRef queryStr As String) As Object
        Dim intTotalSearchResults As Object
        Dim intColumnWidth As Object
        Dim aColumnWidths As Object
        Dim fld As Object
        Dim fldName As Object
        Dim arrFieldsList As Object
        Dim i As Object
        Dim tempstr As Object
        Dim strWhere As Object

        On Error Resume Next

        ''on error GoTo handleError
        FRMmain.Cursor = System.Windows.Forms.Cursors.WaitCursor
        'UPGRADE_WARNING: Couldn't resolve default property of object strWhere. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        strWhere = ""

        '---------------------------------------------------------------------------------------'
        '   get string matching criteria from radio buttons                                     '
        '---------------------------------------------------------------------------------------'
        If FRMmain.optionAnyMatch.Checked = True Then
            queryStr = "%" & queryStr & "%"
        ElseIf FRMmain.optionExactMatch.Checked = True Then
            queryStr = queryStr
        ElseIf FRMmain.optionStartsWith.Checked = True Then
            queryStr = queryStr & "%"
        ElseIf FRMmain.optionEndsWith.Checked = True Then
            queryStr = "%" & queryStr
        ElseIf FRMmain.optionWildCard.Checked = True Then
            queryStr = Replace(queryStr, " ", "")
            queryStr = Replace(queryStr, "/", "")
            queryStr = Replace(queryStr, "\", "")
            queryStr = Replace(queryStr, "-", "")
            queryStr = Replace(queryStr, "/", "")
            queryStr = Replace(queryStr, "(", "")
            queryStr = Replace(queryStr, ")", "")
            queryStr = Replace(queryStr, "[", "")
            queryStr = Replace(queryStr, "]", "")
            queryStr = Replace(queryStr, "_", "")
            queryStr = Replace(queryStr, "|", "")
            queryStr = Replace(queryStr, """", "")
            queryStr = Replace(queryStr, "'", "")
            queryStr = Replace(queryStr, ",", "")
            queryStr = Replace(queryStr, ".", "")
            'UPGRADE_WARNING: Couldn't resolve default property of object tempstr. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            tempstr = "%"
            For i = 1 To Len(queryStr)
                'UPGRADE_WARNING: Couldn't resolve default property of object i. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                'UPGRADE_WARNING: Couldn't resolve default property of object tempstr. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                tempstr = tempstr & Mid(queryStr, i, 1) & "%"
            Next
            'UPGRADE_WARNING: Couldn't resolve default property of object tempstr. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            queryStr = tempstr
        End If
        '---------------------------------------------------------------------------------------'
        '   create "WHERE" clause for SQL statement                                             '
        '---------------------------------------------------------------------------------------'
        If fieldTosearch = "All" Then
            'UPGRADE_WARNING: Couldn't resolve default property of object strWhere. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            strWhere = " WHERE "
            'UPGRADE_WARNING: Couldn't resolve default property of object arrFieldsList. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            arrFieldsList = Split(strFieldsList, ",")
            For Each fldName In arrFieldsList
                'UPGRADE_WARNING: Couldn't resolve default property of object fldName. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                'UPGRADE_WARNING: Couldn't resolve default property of object strWhere. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                strWhere = strWhere & tableToSearch & ".[" & fldName & "] LIKE '" & queryStr & "' OR "
            Next fldName
            'UPGRADE_WARNING: Couldn't resolve default property of object strWhere. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            strWhere = Left(strWhere, Len(strWhere) - 3)
        Else
            'UPGRADE_WARNING: Couldn't resolve default property of object strWhere. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            strWhere = " WHERE " & tableToSearch & ".[" & fieldTosearch & "] LIKE '" & queryStr & "'"
        End If
        'UPGRADE_WARNING: Couldn't resolve default property of object strWhere. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        openStr = "SELECT * FROM " & tableToSearch & strWhere
        'UPGRADE_WARNING: Couldn't resolve default property of object FRMmain.Adodc1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        FRMmain.Adodc1.RecordSource = openStr
        'UPGRADE_WARNING: Couldn't resolve default property of object FRMmain.Adodc1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        FRMmain.Adodc1.Refresh()
        Dim rs As ADODB.Recordset
        'UPGRADE_WARNING: Couldn't resolve default property of object FRMmain.Adodc1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        rs = FRMmain.Adodc1.Recordset
        FRMmain.LBLresultsCount.Text = CStr(rs.RecordCount)
        '---------------------------------------------------------------------------------------'
        '   set column widths for the dataGrid after each search                                '
        '---------------------------------------------------------------------------------------'
        'UPGRADE_WARNING: Couldn't resolve default property of object i. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        i = 0
        For Each fld In rs.Fields

            If IsArray(aColumnWidths) Then

                If IsNumeric(aColumnWidths(i)) Then

                    'UPGRADE_WARNING: Couldn't resolve default property of object aColumnWidths(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                    'UPGRADE_WARNING: Couldn't resolve default property of object intColumnWidth. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                    intColumnWidth = aColumnWidths(i)

                Else

                    'UPGRADE_WARNING: Couldn't resolve default property of object intColumnWidth. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                    intColumnWidth = 50

                End If

            Else

                'UPGRADE_WARNING: Couldn't resolve default property of object intColumnWidth. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                intColumnWidth = 50

            End If

            'UPGRADE_WARNING: Couldn't resolve default property of object intColumnWidth. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            FRMmain.DataGrid.Columns(i).Width = VB6.TwipsToPixelsX(intColumnWidth)

            If IsArray(aColumnWidths) Then

                'UPGRADE_WARNING: Couldn't resolve default property of object i. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                If i < UBound(aColumnWidths) Then

                    'UPGRADE_WARNING: Couldn't resolve default property of object i. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                    i = i + 1

                End If

            End If

        Next fld
        'UPGRADE_WARNING: Couldn't resolve default property of object intTotalSearchResults. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        intTotalSearchResults = 0
        FRMmain.Cursor = System.Windows.Forms.Cursors.Default
        'UPGRADE_WARNING: Couldn't resolve default property of object strWhere. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        strWhere = ""

handleError:
        If Err.Number <> 0 Then
            If Err.Number = -2147217900 Then
                MsgBox("You Have Entered Invalid Search Criteria" & vbCrLf & "Please Try Again")
                FRMmain.TXTsearch.Focus()
                FRMmain.TXTsearch.SelectionStart = 0
                FRMmain.TXTsearch.SelectionLength = Len(FRMmain.TXTsearch.Text)
            Else
                MsgBox("Error : " & Err.Description & "Error Number : " & Err.Number)
            End If
        End If
        FRMmain.Cursor = System.Windows.Forms.Cursors.Default
    End Function
    '-----------------------------------------------------'
    '   Save edited row to database                       '
    '-----------------------------------------------------'
    Public Function setRowToUpdate(ByRef strFieldsList As Object) As Object

        On Error Resume Next

        'UPGRADE_WARNING: Couldn't resolve default property of object strFieldsList. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        strRowToUpdateList = strFieldsList
    End Function
    Public Function saveRow() As Object
        Dim X As Object
        Dim splitStrRowToUpdateList As Object
        Dim i As Object
        Dim FRMeditRow As Object

        On Error Resume Next

        Dim conn As ADODB.Connection
        Dim rs As ADODB.Recordset

        Dim strConn, openStr As String

        conn = New ADODB.Connection
        rs = New ADODB.Recordset

        strConn = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & DatabasePath

        conn.Open(strConn)

        rs.let_ActiveConnection(conn)

        'UPGRADE_WARNING: Couldn't resolve default property of object FRMeditRow.Field. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'UPGRADE_WARNING: Couldn't resolve default property of object FRMeditRow.fieldName. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        openStr = "UPDATE " & VB6.GetItemString(FRMmain.LISTtables, FRMmain.LISTtables.SelectedIndex) & "" & " SET [" & FRMeditRow.fieldName(1).Caption & "] = '" & FRMeditRow.Field(1).Text & "'"

        'UPGRADE_WARNING: Couldn't resolve default property of object FRMeditRow.Field. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        For i = 2 To FRMeditRow.Field.Count - 1 - 5

            'UPGRADE_WARNING: Couldn't resolve default property of object FRMeditRow.Field. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            'UPGRADE_WARNING: Couldn't resolve default property of object FRMeditRow.fieldName. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            openStr = openStr & " , " & "[" & FRMeditRow.fieldName(i).Caption & "] = '" & FRMeditRow.Field(i).Text & "'"

        Next

        'UPGRADE_WARNING: Couldn't resolve default property of object splitStrRowToUpdateList. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        splitStrRowToUpdateList = Split(strRowToUpdateList, "||")

        'UPGRADE_WARNING: Couldn't resolve default property of object splitStrRowToUpdateList(0). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'UPGRADE_WARNING: Couldn't resolve default property of object FRMeditRow.fieldName. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        openStr = openStr & " WHERE [" & FRMeditRow.fieldName(1).Caption & "] = '" & splitStrRowToUpdateList(0) & "'"

        For i = 2 To UBound(splitStrRowToUpdateList) - 5
            'UPGRADE_WARNING: Couldn't resolve default property of object i. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            'UPGRADE_WARNING: Couldn't resolve default property of object splitStrRowToUpdateList(i - 1). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            'UPGRADE_WARNING: Couldn't resolve default property of object FRMeditRow.fieldName. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            openStr = openStr & " AND [" & FRMeditRow.fieldName(i).Caption & "] = '" & splitStrRowToUpdateList(i - 1) & "'"
        Next
        'openStr = openStr & ";"
        'debug.print openStr
        'UPGRADE_WARNING: Couldn't resolve default property of object X. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        X = 1
        rs.Open(openStr, conn, 1, 3)
        'UPGRADE_WARNING: Couldn't resolve default property of object FRMmain.Adodc1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        FRMmain.Adodc1.Refresh()
        conn.Close()
        'UPGRADE_NOTE: Object rs may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"'
        rs = Nothing
        'UPGRADE_NOTE: Object conn may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"'
        conn = Nothing
        'UPGRADE_ISSUE: Unload FRMeditRow was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="875EBAD7-D704-4539-9969-BC7DBDAA62A2"'
        FRMeditRow.Close()
    End Function
    '-------------------------------------------------------'
    '   Set the listBox for the import dialog               '
    '-------------------------------------------------------'
    Public Function setImportTablesCombo(ByRef importFileName As String) As Object
        Throw New NotImplementedException
        'On Error Resume Next

        'Dim conn As ADODB.Connection
        'Dim rSchema As ADODB.Recordset
        'conn = New ADODB.Connection
        'conn.Open("Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=" & importFileName)
        'rSchema = conn.OpenSchema(ADODB.SchemaEnum.adSchemaTables)

        ''UPGRADE_WARNING: Couldn't resolve default property of object DLGimport.COMBimportFileTable. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'DLGimport.COMBimportFileTable.Clear()
        'Do Until rSchema.EOF
        '	If rSchema.Fields("TABLE_TYPE").Value = "TABLE" Then
        '		'UPGRADE_WARNING: Couldn't resolve default property of object DLGimport.COMBimportFileTable. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        '		DLGimport.COMBimportFileTable.AddItem(rSchema.Fields("TABLE_NAME"))
        '	End If
        '	rSchema.MoveNext()
        'Loop 
        ''UPGRADE_WARNING: Couldn't resolve default property of object DLGimport.COMBimportFileTable. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'If DLGimport.COMBimportFileTable.ListCount > 0 Then
        '	'UPGRADE_WARNING: Couldn't resolve default property of object DLGimport.COMBimportFileTable. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        '	DLGimport.COMBimportFileTable.ListIndex = 0
        'End If
        'rSchema.Close()
        'conn.Close()
        ''UPGRADE_NOTE: Object rSchema may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"'
        'rSchema = Nothing
        ''UPGRADE_NOTE: Object conn may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"'
        'conn = Nothing

    End Function

    Private ReadOnly Property ConnectionString() As String
        Get
            ConnectionString = String.Format(ConnectionStringFormat, DatabasePath)
        End Get
    End Property

End Module
